<%@page import="service.UserService"%>
<%@page import="entities.UserEntity"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";

	/*
	 *  path="/StudentStreet_BS"	
	 *	basePath = "http://likebamboo-pc:8080/StudentStreet_BS/" */
	String userName = (String) session.getAttribute("userName");
	UserEntity user = new UserEntity();
	if (userName == null) {
		response.sendRedirect("../logReg.jsp?action=login");
	} else {
		user = UserService.getUser(userName);
	}
%>

<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>用户首页-<%=userName%></title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!-- 记得此处的改动 -->
<link type="text/css" rel="stylesheet"
	href="<%=basePath%>user/css/index.css" />

</head>

<body>
	<jsp:include page="../header.jsp"></jsp:include>
	<div id="userName" style="height: 33px;"><%=userName%></div>

	<div id="cs-acc-contain">
		<div class="page-top">
			<h1><%=user.getName()%>的帐户
			</h1>
		</div>
		<div class="column-holder">
			<div class="primary">
				<div class="action-box rounded">
					<div class="titlebar">
						<h2>购物车与订单</h2>
						<h3>查看最近的购物记录</h3>
					</div>
					<div class="listbar">
						<div class="listbox">
							<h4>查看历史记录</h4>
							<ul>
								<li><a href="shopCart.jsp">我的购物车 </a>
								</li>
								<li><a href="user/orderHistory.jsp?action=history">历史订单记录 </a>
								</li>
								<li><a href="user/orderHistory.jsp?action=notDelivery">查看未发货订单</a>
								</li>
							</ul>
						</div>
						<div class="listbox">
							<h4>更多订单操作</h4>
							<ul>	
								<li><a href="user/orderHistory.jsp?action=collect">我的收藏夹</a>
								</li>
								<li><a href="user/orderHistory.jsp?action=count">历史交易统计</a>
								</li>
							</ul>
						</div>
						<div class="clear"></div>
					</div>
					<div class="clear"></div>
				</div>

				<div class="action-box rounded">
					<div class="titlebar">
						<h2>设置</h2>
						<h3>电话、密码、地址等</h3>
					</div>
					<div class="listbar">
						<div class="listbox ">
							<h4>我的账户信息</h4>
							<ul>
								<li>用户名: <span><%=user.getName()%></span>
								</li>
								<li>电&nbsp;&nbsp;&nbsp;话: <span><%=user.getTel()%></span></li>
								<li>邮&nbsp;&nbsp;&nbsp;箱: <span><%=user.getEmail()%></span>
								</li>
								<li>地&nbsp;&nbsp;&nbsp;址: <span><%=user.getAddr()%></span>
								</li>
							</ul>
						</div>
						<div class="listbox userInfo">
							<h4>&nbsp;</h4>
							<ul>
								<li>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别: <span><%=user.getSex()%></span>
								</li>
								<li>校&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区: <span><%=user.getCampus()%></span>
								</li>
								<li>注册时间: <span><%=user.getRegTime()%></span></li>

							</ul>
						</div>
						<div class="listbox userInfo">
							<h4>账户设置</h4>
							<ul>
								<li><a href="user/userInfo.jsp?action=userInfo">修改账户信息</a>
								</li>
								<li><a href="user/userInfo.jsp?action=password">修改密码</a>
								</li>
							</ul>
						</div>

						<div class="clear"></div>
					</div>
					<div class="clear"></div>
				</div>
				<div class="action-box rounded">
					<div class="titlebar">
						<h2>个性化</h2>
						<h3>推荐、浏览和参与</h3>
					</div>
					<div class="listbar">
						<div class="listbox">
							<h4>个性化推荐</h4>
							<ul>
								<li><a href="user/personalize.jsp?action=recommende">为我推荐</a></li>
							<!-- 	<li><a href="user/personalize.jsp?action=analyse">购物车分析</a></li> -->
							</ul>
						</div>
						<div class="listbox">
							<h4>其他</h4>
							<ul>
								<li><a href="user/personalize.jsp?action=scan">我的浏览历史</a>
								</li>
								<li><a href="user/personalize.jsp?action=comment">我发表的商品评论</a>
								</li>
							</ul>
						</div>
						<div class="clear"></div>
					</div>
					<div class="clear"></div>
				</div>
			</div>
		</div>
		<div class="clear"></div>

	</div>

	<jsp:include page="../footer.jsp"></jsp:include>
</body>
</html>
